"""
作者:张玲
把点击去结算的页面设置成一个类
"""

#引入模块
from MY_ECShop.common.base import create_browser,Base

#将跳转的随身风扇页继续购物面定义成一个类
class PageSettlementGoods(Base):
    #定义属性
    url = ('http://localhost:8080/ecshop/flow.php?step=cart')
    settlement_button = ('xpath','//div[@class="flowBox"]/table/tbody/tr/td[2]/a/img')
    clear_button = ('xpath','//input[@class="bnt_blue_1" and @value="清空购物车"]')
    #定义方法
    #进入随身风扇的网址页面
    def page_buy_open_web(self):
        self.base_open_web(self.url)

    #点击清空购物车按钮
    def page_buy_clear_click(self):
        self.base_click(self.clear_button)

    #点击结算按钮
    def page_buy_settlement_click(self):
        self.base_click(self.settlement_button)

if __name__ == '__main__':
    my_browser = create_browser()
    b1 = PageSettlementGoods(my_browser)
    b1.page_buy_open_web()
    b1.page_buy_clear_click()


